		$(function(){
		
			
	
		});
		function reload(){
			$('#roletree').tree('reload');
		}
		function getChildNodes(){
			var node = $('#roletree').tree('getSelected');
			if (node){
				var children = $('#roletree').tree('getChildNodes', node.target);
				var s = '';
				for(var i=0; i<children.length; i++){
					s += children[i].text + ',';
				}
				alert(s);
			}
		}
		function getChecked(){
			var nodes = $('#roletree').tree('getChecked');
			var s = '';
			for(var i=0; i<nodes.length; i++){
				if (s != '') s += ',';
				s += nodes[i].text;
			}
			alert(s);
		}
		function getSelected(){
			var node = $('#roletree').tree('getSelected');
			
			//alert(node.text+node.id);
		}
		function collapse(){
			var node = $('#roletree').tree('getSelected');
			$('#roletree').tree('collapse',node.target);
		}
		function expand(){
			var node = $('#roletree').tree('getSelected');
			$('#roletree').tree('expand',node.target);
		}
		function collapseAll(){
			$('#roletree').tree('collapseAll');
		}
		function expandAll(){
			$('#roletree').tree('expandAll');
		}
		function append(){
			var node = $('#roletree').tree('getSelected');
			$('#roletree').tree('append',{
				parent: node.target,
				data:[{
					text:'new1',
					checked:true
				},{
					text:'new2',
					state:'closed',
					children:[{
						text:'subnew1'
					},{
						text:'subnew2'
					}]
				}]
			});
		}
		function remove(){
			var node = $('#roletree').tree('getSelected');
			$('#roletree').tree('remove', node.target);
		}
		function update(){
			var node = $('#roletree').tree('getSelected');
			if (node){
				node.text = '<span style="font-weight:bold">new text</span>';
				node.iconCls = 'icon-save';
				$('#roletree').tree('update', node);
			}
		}
		function isLeaf(){
			var node = $('#roletree').tree('getSelected');
			var b = $('#roletree').tree('isLeaf', node.target);
	
		}
